#include "stdafx.h"

#pragma once

void Push(Node** stack, int data)
{
	Node* newNode = new Node;
	newNode->data = data;
	newNode->next = *stack;

	*stack = newNode;
}

int Pop(Node** stack)
{
	Node* top = *stack;
	*stack = (*stack)->next;
	return top->data;
}

void UseStack()
{
	using namespace std;

	Node* stack;
	Push(&stack, 1);
	cout << Pop(&stack) << endl;
}